/**
 * Generate time : 2011-06-01 3:13:25
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cs.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCSVariable table comment : 变量
 */
public class ZMCSVariable extends DaoEPBase {

	private String fdKeyId = " "; /* FD_KEY_ID */
	private String fdParentId = " "; /* 父级节点ID */
	private String fdParentTable = " "; /* 父级节点TABLE */
	private String fdNo = " "; /* 变量编号 */
	private String fdName = " "; /* 变量名称 */
	private String fdUnitId = " "; /* 单位ID */
	private String fdStatus = " "; /* 状态 */
	private String fdType = " "; /* 变量类型 */
	private String fdIsShow = " "; /* 是否显示 */
	private Long fdDeviationValue = new Long(0); /* 偏差值 */
	private Long fdCycle = new Long(0); /* 采样周期 */
	private String fdDatainterfaceId = " "; /* 数据接口ID */
	private String fdRemarks = " "; /* 备注 */
	private String fdIHKeyId = " "; /* iHistory数据源ID */
	private String fdTagNo = " "; /* 点号 */
	private String fdInterfaceType = " "; /* 数据源类型 */
	
	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("父级节点ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentTable");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("父级节点TABLE");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdNo");
		eiColumn.setFieldLength(10);
		eiColumn.setDescName("变量编号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("变量名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdUnitId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("单位ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdStatus");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName("状态");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdType");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("变量类型");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsShow");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("是否显示");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDeviationValue");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("是否分析");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdCycle");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("采样周期");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDatainterfaceId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("数据接口ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRemarks");
		eiColumn.setFieldLength(500);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIHKeyId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("iHistory主键");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdTagNo");
		eiColumn.setFieldLength(200);
		eiColumn.setDescName("点号");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdInterfaceType");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("数据源类型");
		eiMetadata.addMeta(eiColumn);
	}

	/**
	 * the constructor
	 */
	public ZMCSVariable() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - FD_KEY_ID
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - FD_KEY_ID
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdParentId - 父级节点ID
	 * 
	 * @return the fdParentId
	 */
	public String getFdParentId() {
		return this.fdParentId;
	}

	/**
	 * set the fdParentId - 父级节点ID
	 */
	public void setFdParentId(String fdParentId) {
		this.fdParentId = fdParentId;
	}

	/**
	 * get the fdParentTable - 父级节点TABLE
	 * 
	 * @return the fdParentTable
	 */
	public String getFdParentTable() {
		return this.fdParentTable;
	}

	/**
	 * set the fdParentTable - 父级节点TABLE
	 */
	public void setFdParentTable(String fdParentTable) {
		this.fdParentTable = fdParentTable;
	}

	/**
	 * get the fdNo - 变量编号
	 * 
	 * @return the fdNo
	 */
	public String getFdNo() {
		return this.fdNo;
	}

	/**
	 * set the fdNo - 变量编号
	 */
	public void setFdNo(String fdNo) {
		this.fdNo = fdNo;
	}

	/**
	 * get the fdName - 变量名称
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * set the fdName - 变量名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the fdUnitId - 单位ID
	 * 
	 * @return the fdUnitId
	 */
	public String getFdUnitId() {
		return this.fdUnitId;
	}

	/**
	 * set the fdUnitId - 单位ID
	 */
	public void setFdUnitId(String fdUnitId) {
		this.fdUnitId = fdUnitId;
	}

	/**
	 * get the fdStatus - 状态
	 * 
	 * @return the fdStatus
	 */
	public String getFdStatus() {
		return this.fdStatus;
	}

	/**
	 * set the fdStatus - 状态
	 */
	public void setFdStatus(String fdStatus) {
		this.fdStatus = fdStatus;
	}

	/**
	 * get the fdType - 是否存储
	 * 
	 * @return the fdType
	 */
	public String getfdType() {
		return this.fdType;
	}

	/**
	 * set the fdType - 是否存储
	 */
	public void setfdType(String fdType) {
		this.fdType = fdType;
	}

	/**
	 * get the fdIsShow - 是否显示
	 * 
	 * @return the fdIsShow
	 */
	public String getFdIsShow() {
		return this.fdIsShow;
	}

	/**
	 * set the fdIsShow - 是否显示
	 */
	public void setFdIsShow(String fdIsShow) {
		this.fdIsShow = fdIsShow;
	}

	/**
	 * get the fdDeviationValue - 是否分析
	 * 
	 * @return the fdDeviationValue
	 */
	public Long getfdDeviationValue() {
		return this.fdDeviationValue;
	}

	/**
	 * set the fdDeviationValue - 是否分析
	 */
	public void setfdDeviationValue(Long fdDeviationValue) {
		this.fdDeviationValue = fdDeviationValue;
	}

	/**
	 * get the fdCycle - 采样周期
	 * 
	 * @return the fdCycle
	 */
	public Long getFdCycle() {
		return this.fdCycle;
	}

	/**
	 * set the fdCycle - 采样周期
	 */
	public void setFdCycle(Long fdCycle) {
		this.fdCycle = fdCycle;
	}

	/**
	 * get the fdDatainterfaceId - 数据接口ID
	 * 
	 * @return the fdDatainterfaceId
	 */
	public String getFdDatainterfaceId() {
		return this.fdDatainterfaceId;
	}

	/**
	 * set the fdDatainterfaceId - 数据接口ID
	 */
	public void setFdDatainterfaceId(String fdDatainterfaceId) {
		this.fdDatainterfaceId = fdDatainterfaceId;
	}

	/**
	 * get the fdRemarks - 备注
	 * 
	 * @return the fdRemarks
	 */
	public String getFdRemarks() {
		return this.fdRemarks;
	}

	/**
	 * set the fdRemarks - 备注
	 */
	public void setFdRemarks(String fdRemarks) {
		this.fdRemarks = fdRemarks;
	}

	public String getFdIHKeyId() {
		return fdIHKeyId;
	}

	public void setFdIHKeyId(String fdIHKeyId) {
		this.fdIHKeyId = fdIHKeyId;
	}

	public String getFdTagNo() {
		return fdTagNo;
	}

	public void setFdTagNo(String fdTagNo) {
		this.fdTagNo = fdTagNo;
	}

	public String getFdInterfaceType() {
		return fdInterfaceType;
	}

	public void setFdInterfaceType(String fdInterfaceType) {
		this.fdInterfaceType = fdInterfaceType;
	}
	
	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentId")), fdParentId));
		setFdParentTable(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentTable")), fdParentTable));
		setFdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdNo")), fdNo));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdUnitId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdUnitId")), fdUnitId));
		setFdStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdStatus")), fdStatus));
		setfdType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdType")), fdType));
		setFdIsShow(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdIsShow")), fdIsShow));
		setfdDeviationValue(NumberUtils.toLong(StringUtils.toString(map.get("fdDeviationValue")), fdDeviationValue));
		setFdCycle(NumberUtils.toLong(StringUtils.toString(map.get("fdCycle")), fdCycle));
		setFdDatainterfaceId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDatainterfaceId")), fdDatainterfaceId));
		setFdRemarks(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRemarks")), fdRemarks));
		setFdIHKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdIHKeyId")), fdIHKeyId));
		setFdTagNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTagNo")), fdTagNo));
		setFdInterfaceType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdInterfaceType")), fdInterfaceType));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdParentId", StringUtils.toString(fdParentId, eiMetadata.getMeta("fdParentId")));
		map.put("fdParentTable", StringUtils.toString(fdParentTable, eiMetadata.getMeta("fdParentTable")));
		map.put("fdNo", StringUtils.toString(fdNo, eiMetadata.getMeta("fdNo")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));
		map.put("fdUnitId", StringUtils.toString(fdUnitId, eiMetadata.getMeta("fdUnitId")));
		map.put("fdStatus", StringUtils.toString(fdStatus, eiMetadata.getMeta("fdStatus")));
		map.put("fdType", StringUtils.toString(fdType, eiMetadata.getMeta("fdType")));
		map.put("fdIsShow", StringUtils.toString(fdIsShow, eiMetadata.getMeta("fdIsShow")));
		map.put("fdDeviationValue", StringUtils.toString(fdDeviationValue, eiMetadata.getMeta("fdDeviationValue")));
		map.put("fdCycle", StringUtils.toString(fdCycle, eiMetadata.getMeta("fdCycle")));
		map.put("fdDatainterfaceId", StringUtils.toString(fdDatainterfaceId, eiMetadata.getMeta("fdDatainterfaceId")));
		map.put("fdRemarks", StringUtils.toString(fdRemarks, eiMetadata.getMeta("fdRemarks")));
		map.put("fdIHKeyId", StringUtils.toString(fdIHKeyId, eiMetadata.getMeta("fdIHKeyId")));
		map.put("fdTagNo", StringUtils.toString(fdTagNo, eiMetadata.getMeta("fdTagNo")));
		map.put("fdInterfaceType", StringUtils.toString(fdInterfaceType, eiMetadata.getMeta("fdInterfaceType")));

		return map;

	}
}